package com.mtbu.comm;

import java.util.List;

import com.mtbu.bean.BppCata;
import com.mtbu.service.DataUtil;
import com.util.SuperString;

public class AlgUtil {
	//BPP频道按分类搜索时，将选择的分类的所有子分类拼接到一起
	public static String getAllBppCataIDS(String cataid){
		String cataids = "";
		if(cataid==null || cataid.equals("")) return cataids;
		cataids = cataid;
		String[] arr_cataid = cataid.split(",");
		for(int i=0;i<arr_cataid.length;i++){
			List<BppCata> catalist = DataUtil.getBppCata(SuperString.getInt(arr_cataid[i]), true).getSublist();
			if(catalist==null || catalist.size()==0) continue;
			for(int j=0;j<catalist.size();j++){
				cataids += ","+catalist.get(j).getId();
			}
		}		
		return cataids;
	}
}
